perm filename ANS[LSP,JRA] blob sn#181258 filedate 1975-10-13 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	  alt[x] <= 
C00005 ENDMK
C⊗;
  alt[x] <= 
	[null[x] → ();
	 null[rest[x]] → x
	 t → alt[rest[rest[x]]]
	]

atoms[s] <= atoms*[s;()]
atoms*[s;l] <=
	[atom[s] → concat[s;l]
	 t → atoms*[car[s];atoms*[cdr[s];l]]
	]

merge[x;l] <=
	[null[l] → list[x]
	 lessp[x;first[l]] → concat[x;l]
	 t → concat[first[l];merge[x;rest[l]]]
	]

sort[l] <=
	[null[l] → ();
	 t → merge[first[l];sort[rest[l]]]
	]

atomwo[s] <= atoms*[s;()]
atoms*[s;l] <=
	[atom[s] → [member[s;l] → l; t → concat[s;l]];
	 t → atoms*[car[s];atoms*[cdr[s];l]]
	]

atomdup[s] <= strain[atom*[s;()]]
atoms*[s;l] <=
	[atom[s] → lookup[s;l];
	 t → atoms*[car[s];atoms*[cdr[s];l]]
	]

lookup[s;l] <=
	[null[l] → list[mkent[s;1]];
	 eq[s;name[first[l]]] → concat[mkent[s;val[first[l]+1]];rest[l]];
	 t → concat[first[l];lookup[s;rest[l]]]
	]

strain[l] <=
	[null[l] → ();
	 eq[val[first[l];1] → strain[rest[l]];
	 t → concat[first[l];strain[rest[l]]]
	]



inst[e;p;m] <=
	[equal[m;NO] → NO;
	 isvar [p] → checkit[p;assoc[p,m];e;m]
	 atom[p] → [equal[p;e] → m; t → NO];
	 atom[e] → NO;
	 t → inst[rest[e];rest[p];inst[first[e];first[p];m]]
	]

checkit[p;v;e;m] <=
	[null[v] → concat[mkent[p;e];m]
	 equal[e;v] → m;
	 t → NO]

occursexpr[s1;s2] <= 

occursin[s1;s2] <=
	[equal[s1;s2] → t
	 occursin[car[s1];s2] → t;
	 t → occursin[cdr[s1];s2]
	]